package com.example.dp.jiemian.bt5;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;

import com.example.dp.jiemian.R;
import com.example.dp.jiemian.bt5.bean.myTextView;

public class bt5 extends AppCompatActivity {
    private EditText et;
    private myTextView tv;
    private Button bt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //取消标题
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        //取消状态栏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //关闭休眠
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        setContentView(R.layout.activity_bt5);

        et = findViewById(R.id.bt5_et);
        tv = findViewById(R.id.bt5_tv);
        bt = findViewById(R.id.bt5_bt);

        bt.setOnClickListener(v -> {
            String text = et.getText().toString();
            et.setVisibility(View.INVISIBLE);
            bt.setVisibility(View.INVISIBLE);
            tv.setMyContext(text);
            tv.setL2r(false);
            tv.setMySpeed(15);
            tv.startScroll();
        });
    }
}
